@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');
/* 
1.利用label的for来做选中效果
2.用div写一个块绝对定位用于上下移动制作选中动画
3.通过选中来判断是否显示或隐藏哪块文字内容
 */
*{
    font-family: 'Poppins', sans-serif;
}

body{
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dad3f8;
}

::selection{
    background: #6d50e2;
    color: #fff;
}

.container{
    max-width: 950px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    margin: 0 20px;
    padding: 40px 50px 40px 40px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
}

.container .topic{
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 20px;
}

.content{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content .list{
    display: flex;
    flex-direction: column;
    position: relative;
    width: 20%;
    margin-right: 50px;
}

.content .list label{
    height: 60px;
    font-size: 22px;
    font-weight: 500;
    line-height: 60px;
    cursor: pointer;
    padding-left: 25px;
    color: #333;
    z-index: 12;
    transition: all .5s ease;
}

.content .list label:hover{
    color: #6d50e2;
}

#home:checked ~ .list label.home,
#blog:checked ~ .list label.blog,
#help:checked ~ .list label.help,
#code:checked ~ .list label.code,
#about:checked ~ .list label.about{
    color: #fff;
}

/* 上下来回盖住，加以动画 */
.content .slider{
    /* 使用动画，方便控制距离 */
    position: absolute;
    height: 60px;
    width: 100%;
    top: 0;
    left: 0;
    background: #6d50e2;
    border-radius: 12px;
    transition: all .4s ease;
}

/* 选中时控制距离 */
#home:checked ~ .list .slider{
    top: 0;
}

#blog:checked ~ .list .slider{
    top: 60px;
}

#help:checked ~ .list .slider{
    top: 120px;
}

#code:checked ~ .list .slider{
    top: 180px;
}

#about:checked ~ .list .slider{
    top: 240px;
}

.content .text-content{
    width: 80%;
    height: 100%;
}

.content .text{
   display: none;
}

.content .text .title{
    font-size: 25px;
    font-weight: 500;
    margin-bottom: 10px;
}

.content .text p{
    /* 两端对齐 */
    text-align: justify;
}

/* 默认显示home内容文字 */
.content .text-content .home{
    display: block;
}

/* 选中对应id的内容文字就显示出来 */
#home:checked ~ .text-content .home,
#blog:checked ~ .text-content .blog,
#help:checked ~ .text-content .help,
#code:checked ~ .text-content .code,
#about:checked ~ .text-content .about{
    display: block;
}

/* 非home id选中，home内容文字就隐藏 */
#blog:checked ~ .text-content .home,
#help:checked ~ .text-content .home,
#code:checked ~ .text-content .home,
#about:checked ~ .text-content .home{
    display: none;
}

/* 隐藏单选框 */
.content input{
    display: none;
}

